package com.heima.ai.config;

import com.alibaba.nacos.shaded.com.google.protobuf.Message;

import java.util.List;

public interface ChatMemory {

    // TODO: consider a non-blocking interface for streaming usages
    default void add(String conversationId, Message message) {
       this.add(conversationId, List.of(message));
    }

    // 添加会话信息到指定conversationId的会话历史中
    void add(String conversationId, List<Message> messages);

    // 根据conversationId查询历史会话
    List<Message> get(String conversationId, int lastN);

    // 清除指定conversationId的会话历史
    void clear(String conversationId);

}